home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / samples / Multimedia / DirectDraw / OverlayAnimate / readme.txt < prev    next >
Encoding:
Text File  |  2001-10-10  |  1.9 KB  |  49 lines

  1. //-----------------------------------------------------------------------------
  2. // 
  3. // Sample Name: OverlayAnimate Sample
  4. // 
  5. // Copyright (c) 1999-2001 Microsoft Corporation. All rights reserved.
  6. // 
  7. //-----------------------------------------------------------------------------
  8.  
  9.  
  10. Description
  11. ===========
  12.   OverlayAnimate demonstrates how to use DirectDraw overlays.  
  13.  
  14. Path
  15. ====
  16.   Source: DXSDK\Samples\Multimedia\DDraw\OverlayAnimate
  17.  
  18.   Executable: DXSDK\Samples\Multimedia\DDraw\Bin
  19.  
  20. User's Guide
  21. ============
  22.   OverlayAnimate requires no user input. Press the ESC key to quit the program.
  23.  
  24. Programming Notes
  25. =================
  26.   For details on how to setup a windowed mode DirectDraw app, see the WindowedMode
  27.   sample. 
  28.   
  29.   To use overlays in general do the following steps in addition to those needed to 
  30.   author a windowed mode DirectDraw app:
  31.     1. Check to see if hardware supports overlays - check IDirectDraw::GetCaps 
  32.        for DDCAPS_OVERLAY.
  33.     2. Size the window to meet the hardware overlay size restrictions.
  34.     3. Create an overlay surface (create it with 1 backbuffer if needed), and 
  35.        set its pixel format to a desired format that is supported by the device.  
  36.     4. Set the dest color key on the overlay to the background color of the window. 
  37.        Be sure to choose a color for the background of the window that Windows typically
  38.        does not use otherwise, the overlay will be drawn on top of overlapping windows.
  39.     5. Call UpdateOverlay to display or hide the overlay on the desktop.  WM_PAINT is 
  40.        a good place for this.
  41.     6. When WM_SIZE or WM_MOVE is sent, then update the src and dest rects and 
  42.        check to make sure that they are within the hardware limits.
  43.        
  44.   To animate the overlay, instead of drawing to the off-screen plain back buffer as 
  45.   in windowed mode case, just draw to the the overlay's backbuffer then flip it. 
  46.  
  47.   
  48.   
  49.